
<div class="card-block bg-white">
  <div class="block">
    <h4 class="first">基本信息</h4>
    <div class="row">
      <div class="col-md-2">
        <span>标题</span> <span class="font-red">*</span>
      </div>
      <div class="col-md-4">
        <input type="text" [(ngModel)]="data.name" class="from-control input" placeholder="请输入 1 - 80 个字符作为题目标题"/>
      </div>
    </div>
    <div class="row">
      <div class="col-md-2">
        <span>难度</span> <span class="font-red">*</span>
      </div>
      <div class="col-md-4">
        <select [(ngModel)]="data.degree" class="from-control input" >
          <option selected="selected">1</option>
          <option value="2">2</option>
          <option value="3">3</option>
          <option value="4">4</option>
          <option value="5">5</option>
        </select>
      </div>
    </div>
    <div class="row">
      <div class="col-md-2">
        <span>作者</span> <span class="font-red">*</span>
      </div>
      <div class="col-md-4">
        <input type="text" [(ngModel)]="data.author" class="from-control input" placeholder="请输入作者名称"/>
      </div>
    </div>
    <div class="row">
      <div class="col-md-2">
        <span>单位</span> <span class="font-red">*</span>
      </div>
      <div class="col-md-4">
        <input type="text" [(ngModel)]="data.company" class="from-control input" placeholder="请输入所在单位"/>
      </div>
    </div>
  </div>



  <div style="border-bottom: 1px solid #E5E5E5;margin-top: 1.25rem;margin-bottom:1.25rem"></div>

  <div class="block">
    <h4>题目描述 <span class="font-red">*</span></h4>
    <div class="row">
      <div id="test-editormd">
       <textarea id="edit" [(ngModel)]="data.describe" style="display:none;"></textarea>
      </div>
    </div>
  </div>
  <div style="border-bottom: 1px solid #E5E5E5"></div>
  <div class="block">
    <h4 class="first">题目判定设置</h4>
    <div class="row">
      <div class="col-md-2">
        <span>时间限制</span> <span class="font-red">*</span>
      </div>
      <div class="col-md-3">
        <div class="from-control">
          <input [(ngModel)]="data.limitTime" class="input" type="number" value="1000"/>
          <div class="input-addon">ms</div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-md-2">
        <span>内存限制</span> <span class="font-red">*</span>
      </div>
      <div class="col-md-3">
        <div class="from-control">
          <input class="input" [(ngModel)]="data.limitMoney" type="number" value="64"/>
          <div class="input-addon">MB</div>
        </div>
      </div>
    </div>
  </div>

  <div style="border-bottom: 1px solid #E5E5E5;margin-top: 1.25rem;margin-bottom:1.25rem"></div>

  <div class="block">
    <h4 class="first">测试数据 <span class="font-red">*</span></h4>
    <div>
      <h6>测试数据打包文件格式说明：</h6>
      <ol>
        <li>压缩格式只支持 zip。测试数据压缩前总大小不可超过 10 MB</li>
        <li>压缩包内文件不要有目录结构，所有文件放在最上层</li>
        <li>压缩包内文件名区分大小写，文件名中不允许出现中文</li>
        <li>输入文件名为 [case_name].in 输出文件名为 [case_name].out 分数文件名为 scores.txt</li>
        <li><strong>所有文件都必须为 Unix 格式 (UTF-8) 文本</strong></li>
        <li>分数文件中每行格式为 [case_name] [score] #[要点提示]# 空格分开，其中 [要点提示] 不超过40个中文字符，简要描述测试要点，如果省略，则为无提示
        </li>
        <li>分数文件不可包含超过 20 个测试用例</li>
        <li>如果没有分数文件指定，新创建的测试用例每个 10 分</li>
        <li><strong>程序填空仅使用第一组测试文件，且不需要分数文件 scores.txt</strong></li>
      </ol>
      <h5>测试数据样例打包文件，请按此样例上传：<a href="https://images.pintia.cn/sample.zip">sample.zip</a></h5>
      <p-fileUpload
        name="file"
        url="{{api}}/services/core/upload"
        (onUpload)="onPhotoUpload($event)" accept=".zip" maxFileSize="10000000">
      </p-fileUpload>
    </div>
    <div class="box">
      <div class="box-body no-padding">
        <table class="table table-striped">
          <tr>
            <th>名称</th>
            <th>分数</th>
            <th>提示</th>
            <th>更新时间</th>
          </tr>
          <tr *ngFor="let data of testDataScore">
            <td>{{data.name}}</td>
            <td>{{data.score}}</td>
            <td>{{data.remark}}</td>
            <td>{{data.date}}</td>
          </tr>
        </table>
      </div>
    </div>
    <div class="row" style="text-align: center">
      <button class=" btn btn-success" (click)="submit()">{{btnText}}</button>
    </div>
  </div>
</div>


